<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<?php
	header('Content-type: text/html; charset=utf-8');
	include_once 'questionario.php';
	include_once 'taglib.php';
	$q= new questionario();
	
	$user = "user";
	$pass = "pass";
	$dbname = "questionario";
	$factory = new ComboTableFactory($dbname,$user,$pass);
	$si_no = $factory->comboTable("si_no");
	$ore_giorno = $factory->comboTable("ore_giorno");
	$ore_settimana = $factory->comboTable("ore_settimana");
	$accordo = $factory->comboTable("accordo");
	$frequenza = $factory->comboTable("frequenza");
	// test assegnamento select
	//$q->impegno_mentale=1;
	
?>

<script language="javascript" type="text/javascript">

function checkForm(){
	//TODO Check
	return confirm("Send form ?");
}

</script>

</head>
<body>
<div id="questionario" class="questionario">
<form action="#" method="post">
<fieldset>
<legend>Test Questionario</legend>
<div>
<table>
	<tr>
		<td><?php new TagInput($q,'eta','text')?></td>
		<td><?php new TagInput($q,'genere','text')?></td>
	</tr>
</table>
</div>
<div>
<table>
	<tr><td><?php new TagCombo($q,$ore_giorno,'ore_giorno',true)?></td></tr>
	<tr><td><?php new TagCombo($q,$ore_settimana,'ore_settimana',true)?></td></tr>
	<tr><td><?php new TagCombo($q,$accordo,'intenso_sforzo_fisico',true)?></td></tr>
	<tr><td><?php new TagCombo($q,$si_no,'lavoro_malato',true)?></td></tr>
	<tr><td><?php new TagCombo($q,$si_no,'lavoro_eccessivo',true)?></td></tr>
	<tr><td><?php new TagCombo($q,$si_no,'impegno_mentale',true)?></td></tr>
</table>
</div>
</fieldset>
<input name="sub" id="sub" type="button" onclick="checkForm();" value="Invia il Questionario" /> 
</form>
</div>
</body>
</html>